﻿package visualizer.code {
	
	// Imported Classes
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundLoaderContext;
	import flash.media.SoundMixer;
	import flash.net.URLRequest;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	
	// Class Definition
	public class TrackLoader
	{
		// Constructor
		public function TrackLoader()
		{
			
		}
		
		
		/*
			public function loadTrackByURL(trackURL:String):Boolean
			Summary: The the track at 'trackURL'
			Pre-Conditions:  'trackURL' must be a valid URL to a track
			Post-Conditions: returns the loaded Sound object associated with the URL
		*/
		public function loadTrackByURL(trackURL:String):Sound
		{
			// Create a new sound file
			var audioTrack:Sound = new Sound();
			var req:URLRequest = new URLRequest(trackURL);
			
			// Load Sound
			audioTrack.load(req);
			return audioTrack;
		}
	}
}